package com.devgear.codesizer.model;

// Generated 24-oct-2011 0:54:57 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ParameterType generated by hbm2java
 */
@Entity
@Table(name = "parameter_types", schema = "public")
public class ParameterType implements java.io.Serializable {

	private int idParameterType;
	private Client client;
	private String name;
	private Set<Parameter> parameters = new HashSet<Parameter>(0);
	private Set<ProjectType> projectTypes = new HashSet<ProjectType>(0);

	public ParameterType() {
	}

	public ParameterType(int idParameterType, Client client) {
		this.idParameterType = idParameterType;
		this.client = client;
	}

	public ParameterType(int idParameterType, Client client, String name,
			Set<Parameter> parameters, Set<ProjectType> projectTypes) {
		this.idParameterType = idParameterType;
		this.client = client;
		this.name = name;
		this.parameters = parameters;
		this.projectTypes = projectTypes;
	}

	@Id
	@Column(name = "id_parameter_type", unique = true, nullable = false)
	public int getIdParameterType() {
		return this.idParameterType;
	}

	public void setIdParameterType(int idParameterType) {
		this.idParameterType = idParameterType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_client", nullable = false)
	public Client getClient() {
		return this.client;
	}

	public void setClient(Client client) {
		this.client = client;
	}

	@Column(name = "name", length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "parameterType")
	public Set<Parameter> getParameters() {
		return this.parameters;
	}

	public void setParameters(Set<Parameter> parameters) {
		this.parameters = parameters;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "parameterTypes")
	public Set<ProjectType> getProjectTypes() {
		return this.projectTypes;
	}

	public void setProjectTypes(Set<ProjectType> projectTypes) {
		this.projectTypes = projectTypes;
	}

}
